/**
 * @param {number[][]} stockPrices
 * @return {number}
 */
var minimumLines = function (stockPrices) {
  stockPrices.sort((a, b) => a[0] - b[0])
  let zz = new Set()
  for(let i = 0; i<stockPrices.length-1; i++) {
    const [x1, y1] = stockPrices[i]
    const [x2, y2] = stockPrices[i+1]
    const k = (y2 - y1) / (x2 - x1)
    const b = y1 - k * x1
    zz.add(`${k}-${b}`)
  }
  return zz.size
};


